﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.CodeDom.Compiler;

namespace RobotBattle2.Scripting {
	public sealed class PropertyExpression : Expression {
		public PropertyExpression() { }

		public PropertyExpression(Expression target, SymbolReference property) {
			this.Target = target;
			this.Property = property;
		}

		public Expression Target { get; set; }

		public SymbolReference Property { get; set; }

		public override void Dump(IndentedTextWriter writer) {
			Target.Dump(writer);
			writer.Write('.');
			Property.Dump(writer);
		}

		public override ExpressionType Type { get { return ExpressionType.Property; } }
	}
}
